# Список задач

## Required

- [X] Add validation for certain RecipeSchema fields.
- [X] Add view_count to RecipeDB schema.
- [X] In DB Model, set view_count default to 0.
- [X] Add logic to increase views count on each get by id.
- [X] Sort recipe list by view_count desc, cooking_time asc.
- [X] Create separate Schema for recipe list.

## Optional

- [ ] Add tests for data layer.
- [ ] Add tests for service layer.
- [ ] Use exceptions to handle errors.
- [X] Refactor `crud.py` to `services.py`
  - [X] Rename `post()` to `create()`
- [X] Refactor `@app.on_event()` to [Lifespan Events](https://fastapi.tiangolo.com/advanced/events/)
- [X] Refactor using data layer.
- [X] Rename `put` to `update` everywhere; use `patch` method.
